Skip to content

Added support for TencentOS and OpenCloudOS#1926

Merged
riosje merged 3 commits into
nodesource:masterfrom
shouhuanxiaoji:master
Jul 9, 2026
Merged

Added support for TencentOS and OpenCloudOS#1926
riosje merged 3 commits into
nodesource:masterfrom
shouhuanxiaoji:master

Conversation

@shouhuanxiaoji

@shouhuanxiaoji shouhuanxiaoji commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

OpenCloudOS is a derivative distribution of TencentOS, so the description in this article applies to both distributions.

TencentOS use rpm as package management, but it has not /etc/os-release, only has /etc/system-release and /os-release, so added a patch to support.

Summary by CodeRabbit

  • New Features
    • Enhanced RPM-based OS detection in the Node.js setup scripts to properly recognize TencentOS and OpenCloudOS environments.
  • Documentation
    • Refined the Node.js 16.x deprecation notice text formatting for better readability.
  • Chores
    • Expanded RPM-related CI coverage to include TencentOS and OpenCloudOS containers.
    • Updated RPM-minimal CI to automatically select the available package manager (microdnf/dnf/yum) during installs and the NSolid setup/removal steps.

@coderabbitai

coderabbitai Bot commented Mar 9, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The PR broadens RPM OS detection in the generator and setup scripts to recognize TencentOS and OpenCloudOS, and updates RPM CI jobs with matching container images. The rpm-minimal workflow also switches package-manager commands to a runtime-selected value.

Changes

RPM detection and CI coverage

Layer / File(s) Summary
Shared RPM guard expansion
scripts/rpm/script_generator/base_script.sh, scripts/rpm/setup_18.x, scripts/rpm/setup_20.x, scripts/rpm/setup_21.x, scripts/rpm/setup_22.x, scripts/rpm/setup_23.x, scripts/rpm/setup_24.x, scripts/rpm/setup_25.x, scripts/rpm/setup_26.x, scripts/rpm/setup_current.x, scripts/rpm/setup_lts.x
Adds TencentOS and OpenCloudOS checks to the RPM preflight guard using /etc/system-release matching, while keeping the existing error path and RPM detection structure.
Setup 16.x formatting and guard update
scripts/rpm/setup_16.x
Reformats the Node.js deprecation warning list and adds the TencentOS and OpenCloudOS RPM-system checks to the script’s guard.
CI images and package-manager selection
.github/workflows/ci.yaml
Adds TencentOS images to the rpm and rpm-minimal job matrices, adds the OpenCloudOS minimal image, and switches rpm-minimal to select the available package manager dynamically.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • nodesource/distributions#1891: Both PRs touch scripts/rpm/setup_25.x, where the RPM OS-detection gate is extended for TencentOS and OpenCloudOS.
  • nodesource/distributions#1899: Both PRs modify .github/workflows/ci.yaml in RPM-oriented jobs and NSolid-related workflow steps.
  • nodesource/distributions#1938: Both PRs touch RPM workflow logic in .github/workflows/ci.yaml, including rpm-minimal package installation and NSolid install/remove steps.

Suggested reviewers: riosje

Poem

🐰 I sniffed the release and gave a hop,
Tencent and OpenCloud now join the crop.
Greps blink once, then carry on bright,
While CI bunnies run through the night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding TencentOS and OpenCloudOS support across the RPM scripts and CI workflow.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
scripts/rpm/setup_25.x (1)

1-40: Consider consolidating shared logic into a reusable helper.

The RPM detection block, logger function, error handler, and command_exists function are duplicated across all setup_*.x scripts. As new distributions like TencentOS/OpenCloudOS are added, each script must be updated individually (as this PR demonstrates with 8+ files).

Consider extracting these common functions into a shared sourced script (e.g., common.sh) or using a template generator to reduce maintenance burden and ensure consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/rpm/setup_25.x` around lines 1 - 40, Extract the duplicated helpers
(log, handle_error, command_exists) and the RPM detection block into a shared
script (e.g., common.sh) and have each setup_*.x script source that file at the
top; specifically move the functions log, handle_error, command_exists and the
RPM detection if-block into common.sh, export any needed environment/config
variables (or return non-zero on unsupported OS) and replace the in-file copies
with a single "source common.sh" line, then remove the duplicated blocks from
setup_25.x and the other setup_*.x scripts so future distro additions
(TencentOS/OpenCloudOS) only need to update common.sh.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/rpm/script_generator/base_script.sh`:
- Around line 35-38: The conditional guard beginning with "if ! [ -f
/etc/redhat-release ] && ! grep -q \"Amazon Linux\" /etc/system-release ..."
misses fallbacks that check /etc/os-release for TencentOS/OpenCloudOS; update
that if-condition to also grep /etc/os-release (e.g., add "&& ! grep -qi
\"TencentOS\" /etc/os-release 2>/dev/null && ! grep -qi \"OpenCloudOS\"
/etc/os-release 2>/dev/null") so the template recognizes those distros when only
/etc/os-release is present, then regenerate the derived setup_*.x files from the
generator so the change propagates.

In `@scripts/rpm/setup_16.x`:
- Around line 107-110: The guard in the if condition that checks for non-RPM
systems only inspects /etc/system-release and /etc/redhat-release but misses
distributions identified in /etc/os-release; update the conditional around the
multi-line if (the block starting with "if ! [ -f /etc/redhat-release ] \") to
also check /etc/os-release for the same strings ("Amazon Linux", "TencentOS",
"OpenCloudOS") using grep -q /etc/os-release 2>/dev/null (case-insensitively
where used) so machines identified via /etc/os-release are correctly detected
and the RPM-system check behaves the same as newer scripts.
- Around line 69-73: The release-status lines in scripts/rpm/setup_16.x are
stale (the URL/status labels for setup_18.x, setup_20.x, setup_21.x, etc.);
update each URL line (e.g., the literal lines containing
"https://rpm.nodesource.com/setup_16.x",
"https://rpm.nodesource.com/setup_18.x",
"https://rpm.nodesource.com/setup_19.x",
"https://rpm.nodesource.com/setup_20.x",
"https://rpm.nodesource.com/setup_21.x") to reflect the current Node.js release
matrix as of 2026-03-09: mark 18.x and 21.x as EOL, mark 20.x and 22.x as
Maintenance LTS, add or mark 24.x as Active LTS and 25.x as Current, and adjust
colors/annotations (red/green/bold) accordingly so the recommended installer
points to the current LTS (24.x) or Current (25.x) as intended.

---

Nitpick comments:
In `@scripts/rpm/setup_25.x`:
- Around line 1-40: Extract the duplicated helpers (log, handle_error,
command_exists) and the RPM detection block into a shared script (e.g.,
common.sh) and have each setup_*.x script source that file at the top;
specifically move the functions log, handle_error, command_exists and the RPM
detection if-block into common.sh, export any needed environment/config
variables (or return non-zero on unsupported OS) and replace the in-file copies
with a single "source common.sh" line, then remove the duplicated blocks from
setup_25.x and the other setup_*.x scripts so future distro additions
(TencentOS/OpenCloudOS) only need to update common.sh.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2f8e8f6f-9477-4b25-98f5-d76e085486a9

📥 Commits

Reviewing files that changed from the base of the PR and between c6e581b and 6b11f48.

📒 Files selected for processing (11)
  • scripts/rpm/script_generator/base_script.sh
  • scripts/rpm/setup_16.x
  • scripts/rpm/setup_18.x
  • scripts/rpm/setup_20.x
  • scripts/rpm/setup_21.x
  • scripts/rpm/setup_22.x
  • scripts/rpm/setup_23.x
  • scripts/rpm/setup_24.x
  • scripts/rpm/setup_25.x
  • scripts/rpm/setup_current.x
  • scripts/rpm/setup_lts.x

Comment thread scripts/rpm/script_generator/base_script.sh
Comment thread scripts/rpm/setup_16.x
Comment thread scripts/rpm/setup_16.x
@riosje

riosje commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Hi @shouhuanxiaoji , This PR is looking good, thanks for the interest to contribute on the project.
Before testing and merging this would you mind to add the the OS on the github actions flow?

@shouhuanxiaoji

shouhuanxiaoji commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @shouhuanxiaoji , This PR is looking good, thanks for the interest to contribute on the project. Before testing and merging this would you mind to add the the OS on the github actions flow?

I have tried to add support for OS in the CI code, but opencloudos only has minimal support

@QingqLin

Copy link
Copy Markdown

the same issue on OpenCloudOS. The installation script fails to detect it as an RPM-based system. This PR fixes it for me. Would love to see this merged?

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yaml:
- Line 109: The rpm job matrix is missing OpenCloudOS coverage, so update the os
list in the CI workflow’s rpm job to include an OpenCloudOS container alongside
TencentOS. Use the existing rpm-minimal job’s OpenCloudOS image as a reference,
and ensure the full rpm job in the workflow covers the non-minimal OpenCloudOS
path by adding the appropriate opencloudos/opencloudos9 image entry.
- Line 109: The rpm workflow matrix includes tencentos/tencentos4:latest, but
this image does not provide dnf, so the package install step in the CI job will
fail. Update the matrix entry in the CI workflow to either use a TencentOS image
that supports dnf or adjust the rpm job logic to use the package manager
supported by the tencentos/tencentos4:latest leg, referencing the os matrix and
the dnf install/update steps in the workflow.
- Line 201: The rpm-minimal matrix in the CI workflow includes images that do
not ship microdnf, causing the install step to fail. Update the matrix in the
workflow job to remove or replace tencentos/tencentos4-minimal:latest and
opencloudos/opencloudos9-minimal:latest with images that provide microdnf or
dnf, or exclude those entries from this job. Keep the change localized to the
matrix definition so the rpm-minimal job only runs on supported base images.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89dea634-d4f7-4148-a930-16f40b83544e

📥 Commits

Reviewing files that changed from the base of the PR and between 60054d4 and 7be1e25.

📒 Files selected for processing (13)
  • .github/workflows/ci.yaml
  • scripts/rpm/script_generator/base_script.sh
  • scripts/rpm/setup_16.x
  • scripts/rpm/setup_18.x
  • scripts/rpm/setup_20.x
  • scripts/rpm/setup_21.x
  • scripts/rpm/setup_22.x
  • scripts/rpm/setup_23.x
  • scripts/rpm/setup_24.x
  • scripts/rpm/setup_25.x
  • scripts/rpm/setup_26.x
  • scripts/rpm/setup_current.x
  • scripts/rpm/setup_lts.x
✅ Files skipped from review due to trivial changes (1)
  • scripts/rpm/setup_lts.x
🚧 Files skipped from review as they are similar to previous changes (10)
  • scripts/rpm/setup_18.x
  • scripts/rpm/setup_20.x
  • scripts/rpm/setup_23.x
  • scripts/rpm/setup_25.x
  • scripts/rpm/setup_24.x
  • scripts/rpm/script_generator/base_script.sh
  • scripts/rpm/setup_current.x
  • scripts/rpm/setup_16.x
  • scripts/rpm/setup_22.x
  • scripts/rpm/setup_21.x

Comment thread .github/workflows/ci.yaml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yaml (1)

282-283: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Install NSolid step in rpm-minimal still hardcodes microdnf instead of $PM.

The install git step (lines 210–219) detects the package manager and exports it as PM, and the Audit Repository / Install Nodejs steps correctly use ${{ env.PM }}. However, this Install NSolid step was missed and still calls microdnf directly. For matrix entries where the detected PM is dnf or yum (e.g., tencentos/tencentos4-minimal:latest, opencloudos/opencloudos9-minimal:latest), this step will fail.

Proposed fix
       - name: Install NSolid
         if: matrix.version != 25 && matrix.version != 26
         run: |
-          microdnf remove nodejs -y
-          microdnf install nsolid -y
+          ${{ env.PM }} remove nodejs -y
+          ${{ env.PM }} install nsolid -y
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yaml around lines 282 - 283, The Install NSolid step in
the rpm-minimal workflow is still hardcoded to use microdnf, unlike the earlier
package-manager detection flow that exports PM. Update that step to use the same
PM environment variable as the Audit Repository and Install Nodejs steps, so the
package removal/install commands in the workflow work correctly for dnf and
yum-based matrix images as well.
♻️ Duplicate comments (2)
.github/workflows/ci.yaml (2)

109-109: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

tencentos/tencentos4:latest may lack dnfrpm job hardcodes dnf everywhere.

Previously flagged and still unaddressed. The rpm job uses dnf at lines 118–119, 128, 132, and 182–183 without package-manager detection. If tencentos/tencentos4:latest doesn't ship dnf, every step after install git will fail. Consider either using a TencentOS image that includes dnf or adding the same PM-detection logic used in the rpm-minimal job.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yaml at line 109, The rpm job still hardcodes dnf in
multiple steps, which breaks on tencentos/tencentos4:latest if that image does
not include dnf. Update the rpm job in the workflow to either use a TencentOS
image with dnf available or add package-manager detection like the rpm-minimal
job, and apply that logic consistently in the install and update steps currently
using dnf.

109-109: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

OpenCloudOS still missing from the rpm job matrix.

This was previously flagged and remains unresolved. The rpm-minimal job includes opencloudos/opencloudos9-minimal:latest, but the full rpm job only has tencentos/tencentos4:latest. Add opencloudos/opencloudos9:latest to ensure the non-minimal setup path is also tested.

Proposed fix
-        os: [ "fedora:41", "amazonlinux:2023", "rockylinux:9", "rockylinux:8", "redhat/ubi9:latest", "tencentos/tencentos4:latest" ]
+        os: [ "fedora:41", "amazonlinux:2023", "rockylinux:9", "rockylinux:8", "redhat/ubi9:latest", "tencentos/tencentos4:latest", "opencloudos/opencloudos9:latest" ]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yaml at line 109, The rpm job matrix is missing the
full OpenCloudOS image, so the non-minimal RPM path is not covered. Update the
matrix in the CI workflow’s rpm job to include opencloudos/opencloudos9:latest
alongside the existing entries, using the same matrix structure as the
rpm-minimal/opencloudos coverage. Keep the change localized to the os list used
by the rpm job so the setup path is tested without altering other job behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/ci.yaml:
- Around line 282-283: The Install NSolid step in the rpm-minimal workflow is
still hardcoded to use microdnf, unlike the earlier package-manager detection
flow that exports PM. Update that step to use the same PM environment variable
as the Audit Repository and Install Nodejs steps, so the package removal/install
commands in the workflow work correctly for dnf and yum-based matrix images as
well.

---

Duplicate comments:
In @.github/workflows/ci.yaml:
- Line 109: The rpm job still hardcodes dnf in multiple steps, which breaks on
tencentos/tencentos4:latest if that image does not include dnf. Update the rpm
job in the workflow to either use a TencentOS image with dnf available or add
package-manager detection like the rpm-minimal job, and apply that logic
consistently in the install and update steps currently using dnf.
- Line 109: The rpm job matrix is missing the full OpenCloudOS image, so the
non-minimal RPM path is not covered. Update the matrix in the CI workflow’s rpm
job to include opencloudos/opencloudos9:latest alongside the existing entries,
using the same matrix structure as the rpm-minimal/opencloudos coverage. Keep
the change localized to the os list used by the rpm job so the setup path is
tested without altering other job behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5ef45362-f0cc-4456-a13d-6db43a38a0c2

📥 Commits

Reviewing files that changed from the base of the PR and between 7be1e25 and 74fd05b.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • scripts/rpm/setup_26.x
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/rpm/setup_26.x

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/ci.yaml (1)

109-109: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

OpenCloudOS still missing from the rpm job matrix.

This was flagged in a previous review and remains unaddressed. The rpm-minimal job (line 201) includes opencloudos/opencloudos9-minimal:latest, but the full rpm job only adds tencentos/tencentos4:latest. Since the PR objective is to add support for both TencentOS and OpenCloudOS, the full rpm job should also test an OpenCloudOS container to cover the non-minimal setup path.

Proposed fix
-        os: [ "fedora:41", "amazonlinux:2023", "rockylinux:9", "rockylinux:8", "redhat/ubi9:latest", "tencentos/tencentos4:latest" ]
+        os: [ "fedora:41", "amazonlinux:2023", "rockylinux:9", "rockylinux:8", "redhat/ubi9:latest", "tencentos/tencentos4:latest", "opencloudos/opencloudos9:latest" ]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yaml at line 109, The rpm job matrix in the CI workflow
still omits OpenCloudOS, so the full rpm path is not covered. Update the os
matrix for the rpm job alongside the existing entries in the workflow so it also
includes the OpenCloudOS container used by rpm-minimal, keeping TencentOS and
the other current images intact. Locate the matrix under the rpm job in the
workflow and add the OpenCloudOS image there as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yaml:
- Line 109: The rpm job still hardcodes dnf in its package steps, but the matrix
now includes tencentos/tencentos4:latest which does not ship dnf. Update the rpm
job to use the same dynamic package-manager detection pattern already used in
rpm-minimal, and apply it consistently in the install/update/repo/nodejs/nsolid
steps within the rpm workflow. If you prefer not to add detection, replace
tencentos/tencentos4:latest with an image that provides dnf.

---

Duplicate comments:
In @.github/workflows/ci.yaml:
- Line 109: The rpm job matrix in the CI workflow still omits OpenCloudOS, so
the full rpm path is not covered. Update the os matrix for the rpm job alongside
the existing entries in the workflow so it also includes the OpenCloudOS
container used by rpm-minimal, keeping TencentOS and the other current images
intact. Locate the matrix under the rpm job in the workflow and add the
OpenCloudOS image there as well.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6750a336-712a-458c-b4c3-7d6e083eee67

📥 Commits

Reviewing files that changed from the base of the PR and between 74fd05b and 7eddb60.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • scripts/rpm/setup_26.x
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/rpm/setup_26.x

Comment thread .github/workflows/ci.yaml
@riosje riosje merged commit 9b431d8 into nodesource:master Jul 9, 2026
86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants